#include <bits/stdc++.h>

using namespace std;

const int maxn=100005;
const int inf=~0U>>1;
struct Q{
    int id[maxn],val[maxn];
    int f,r;
    Q():f(0),r(0){}
    inline void clear(){f=r=0;}
    inline void push(const int &i,const int &v){
        id[r]=i;val[r++]=v;
    }
    inline int pop(const int &n){
        int left=n;
        while(f<r&&left){
            int delta=min(left,val[r-1]);
            left-=delta;
            val[r-1]-=delta;
            if(!val[r-1]) r--;
        }
        return n-left;
    }
    inline bool hasElement(){return f<r;}
    inline int firstID(){if(hasElement()) return id[f];return -1;}
    inline bool transfer(Q &dest){
        if(hasElement()){
            dest.push(id[f],val[f]);
            f++;
            return true;
        }
        return false;
    }
};

int __d[maxn],d[maxn];
int n,cSlow,nSlow,cQuick,nQuick,cNew;

Q slow,quick,not_available;
inline int minCost(int x){ //x: number of toys to buy
    memcpy(d,__d,sizeof(int)*n);
    slow.clear();quick.clear();not_available.clear();
    int cost=x*(cNew-cSlow);
    slow.push(0,x);
    for(int i=0;i<n;i++){
        while(not_available.hasElement()&&not_available.firstID()<=i-nQuick) not_available.transfer(quick);
        while(quick.hasElement()&&quick.firstID()<=i-nSlow) quick.transfer(slow);
        while(d[i]){
            int delta;
            if(slow.hasElement()) d[i]-=(delta=slow.pop(d[i])),cost+=cSlow*delta;
            else if(quick.hasElement()) d[i]-=(delta=quick.pop(d[i])),cost+=cQuick*delta;
            //else if(x) d[i]-=(delta=min(d[i],x)),x-=delta;
            else return inf;
        }
        not_available.push(i,__d[i]);
    }
    return cost;
}

inline int read(){
    char c;bool f=0;int r;
    for(c=getchar();c>'9'||c<'0';c=getchar()) if(c=='-') f=1;
    for(r=0;c<='9'&&c>='0';c=getchar()) r=r*10+c-'0';
    if(f) return -r;
    else return r;
}

int main(){
    n=read();nSlow=read();nQuick=read();cSlow=read();cQuick=read();cNew=read();
    if(nSlow<nQuick){swap(nSlow,nQuick);swap(cSlow,cQuick);}
    if(cSlow>cQuick){cSlow=cQuick;}
    int l=0x7fffffff,r=0;
    for(int i=0;i<n;i++) __d[i]=read(),r+=__d[i],l=min(l,__d[i]);
    while(r-l>2){
        int x1,x2,y1,y2;
        x1=(2*l+r)/3;
        x2=(l+2*r)/3;
        y1=minCost(x1);y2=minCost(x2);
        if(y1<y2) r=x2;else l=x1;
    }
    int ans=inf;
    for(int i=l;i<=r;i++) ans=min(ans,minCost(i));
    printf("%d\n", ans);
    return 0;
}
